import {get, post, del, put} from "@/apis/http/request";
import {RetailShop} from "@/apis/model/shop/RetailShopModel";

/**
* 得到列表
* @param params
*/
export const getRetailShopList = (params: any) => get("/retailShop/list", params)

/**
* 得到分页列表
* @param params
*/
export const retailShopPage = (params: any) => post("/retailShop/page", params)
export const pageExports = (params: any) => post("/retailShop/pageExports", params,{  responseType: "blob"})
export const updatecityBelong = (params: any) => post("/retailShop/updatecityBelong", params)
export const updateShopBelong = (params: any) => post("/retailShop/updateShopBelong", params)

/**
* 删除数据
* @param id
* @returns
*/
export const deleteRetailShopById = (id: number) => del("/retailShop/delete/"+ id)

/**
* 新增数据
* @param param
*/
export const insertRetailShop = (param: RetailShop) => post("/retailShop", param)

/**
* 更新数据
* @param param
*/
export const updateRetailShop = (param: RetailShop) => put("/retailShop", param)

/**
 * 我的商户
 */
export const adminShopTableTree = (adminId: any) => get("/retailShop/adminShopTableTree/"+adminId)

/**
 * 查询商户信息
 * @param params
 */
export const getShopByOwnerId = (ownerId: number) => get("/retailShop/getShopByOwnerId/"+ ownerId)


/**
 * 商户数据处理
 * @param param
 */
export const insertOrUpdateRetailShop = (param: RetailShop) => post("/retailShop/insertOrUpdateRetailShop", param)

